﻿<%@ Page Title="Tram Huong Spa | News" Language="C#" MasterPageFile="~/MasterPage1.master" AutoEventWireup="true" CodeFile="Page_NewsDetail.aspx.cs" Inherits="Page_NewsDetail" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:FormView ID="FormView1" runat="server" DataKeyNames="Ma" 
        DataSourceID="SqlDataSource1" Width="720px" 
        ondatabinding="FormView1_DataBinding" ondatabound="FormView1_DataBound">
        <EditItemTemplate>
            Ma:
            <asp:Label ID="MaLabel1" runat="server" Text='<%# Eval("Ma") %>' />
            <br />
            MaLoaiTT:
            <asp:TextBox ID="MaLoaiTTTextBox" runat="server" 
                Text='<%# Bind("MaLoaiTT") %>' />
            <br />
            TieuDe:
            <asp:TextBox ID="TieuDeTextBox" runat="server" Text='<%# Bind("TieuDe") %>' />
            <br />
            NoiDung:
            <asp:TextBox ID="NoiDungTextBox" runat="server" Text='<%# Bind("NoiDung") %>' />
            <br />
            ThoiDiem:
            <asp:TextBox ID="ThoiDiemTextBox" runat="server" 
                Text='<%# Bind("ThoiDiem") %>' />
            <br />
            HinhAnh:
            <asp:TextBox ID="HinhAnhTextBox" runat="server" Text='<%# Bind("HinhAnh") %>' />
            <br />
            MoTa:
            <asp:TextBox ID="MoTaTextBox" runat="server" Text='<%# Bind("MoTa") %>' />
            <br />
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="Update" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </EditItemTemplate>
        <InsertItemTemplate>
            MaLoaiTT:
            <asp:TextBox ID="MaLoaiTTTextBox" runat="server" 
                Text='<%# Bind("MaLoaiTT") %>' />
            <br />
            TieuDe:
            <asp:TextBox ID="TieuDeTextBox" runat="server" Text='<%# Bind("TieuDe") %>' />
            <br />
            NoiDung:
            <asp:TextBox ID="NoiDungTextBox" runat="server" Text='<%# Bind("NoiDung") %>' />
            <br />
            ThoiDiem:
            <asp:TextBox ID="ThoiDiemTextBox" runat="server" 
                Text='<%# Bind("ThoiDiem") %>' />
            <br />
            HinhAnh:
            <asp:TextBox ID="HinhAnhTextBox" runat="server" Text='<%# Bind("HinhAnh") %>' />
            <br />
            MoTa:
            <asp:TextBox ID="MoTaTextBox" runat="server" Text='<%# Bind("MoTa") %>' />
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                CommandName="Insert" Text="Insert" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </InsertItemTemplate>
        <ItemTemplate>
            <table style="margin: 10px; width: 97%">
                <tr>
                    <td>
                        <asp:HyperLink ID="hplEdit" runat="server" CssClass="nonunderlink" 
                            ImageUrl="~/images/edit-icon.png" 
                            NavigateUrl='<%# Eval("Ma","~/Admin/Page_UpdateNews.aspx?Id={0}") %>' 
                            Visible="False">Sửa tin này</asp:HyperLink>
                        <asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="Medium" 
                            ForeColor="Black" Text='<%# Eval("TieuDe") %>'></asp:Label>
                        &nbsp;<br />
                    </td>
                </tr>
                <tr>
                    <td>
                        <table style="width: 100%">
                            <tr>
                                <td rowspan="2" style="width: 146px">
                                    <asp:Image ID="Image1" runat="server" Height="120px" ImageAlign="Middle" 
                                        ImageUrl='<%# Eval("HinhAnh", "~/Images/news/{0}") %>' Width="150px" />
                                </td>
                                <td align="left" valign="top">
                                    <asp:Label ID="Label3" runat="server" ForeColor="#333333" 
                                        Text='<%# Eval("MoTa") %>'></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" valign="top">
                                    Đăng lúc:
                                    <asp:Label ID="Label4" runat="server" Font-Italic="True" 
                                        Text='<%# Eval("ThoiDiem", " {0:HH:mm:ss dd/MM/yyyy}") %>' 
                                        ForeColor="#336600"></asp:Label>
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <br />
                        <asp:Label ID="Label2" runat="server" ForeColor="Black" 
                            Text='<%# Eval("NoiDung") %>'></asp:Label>
                    </td>
                </tr>
            </table>
            <br />
        </ItemTemplate>
    </asp:FormView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:TramHuongDB2ConnectionString %>" 
        SelectCommand="SELECT * FROM [TinTuc] WHERE ([Ma] = @Ma)">
        <SelectParameters>
            <asp:QueryStringParameter Name="Ma" QueryStringField="Id" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    
    <table style="width: 100%" id="tbTinMoi" runat="server" visible="false">
        <tr>
            <td>
                <asp:Label ID="Label5" runat="server" Font-Bold="True" Text="Tin mới hơn:"></asp:Label>
            </td>
        </tr>
        <tr>
            <td id="tdTinMoi" runat="server">
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
    </table>
    
    <table style="width: 100%" id="tbTinCu" runat="server" visible="false">
        <tr>
            <td>
                <asp:Label ID="Label6" runat="server" Font-Bold="True" Text="Tin cũ hơn:"></asp:Label>
            </td>
        </tr>
        <tr>
            <td id="tdTinCu" runat="server">
                &nbsp;</td>
        </tr>
    </table>
    
</asp:Content>

